//
//  tapGestureViewController.m
//  mintHome
//
//  Created by 朱彦名 on 16/6/20.
//  Copyright © 2016年 朱彦名. All rights reserved.
//

#import "tapGestureViewController.h"
#import "modelOfMintHome.h"
#import <SDWebImage/UIImageView+WebCache.h>
#import "NetWorkingHandler.h"

@interface tapGestureViewController ()<UIWebViewDelegate>

@property (nonatomic, retain) NSMutableArray *arrOfImage;
@property (nonatomic, retain) UIWebView *webview;
@end

@implementation tapGestureViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"攻略详情";
    self.arrOfImage = [NSMutableArray array];
    
    [self webVIew];

}
- (UIWebView *)webVIew{
    UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    webView.delegate = self;
    
    [MBProgressHUDManager showHUDtoView:webView string:@"加载中"];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url1]]];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url2]]];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url3]]];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url4]]];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url5]]];
    
    [self.view addSubview:webView];
    return webView;
}

#pragma mark - UIWebView的delegate代理
- (void)webViewDidFinishLoad:(UIWebView *)webView {
    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.getElementsByClassName('purchase-content')[0].style.display = 'none'"];
    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.getElementsByClassName('header-sm')[0].style.display = 'none'"];
    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.getElementsByClassName('content-right')[0].style.display = 'none'"];
    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.getElementsByClassName('download-content')[0].style.display = 'none'"];
    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.getElementsByClassName('header')[0].style.display = 'none'"];            
    
    [MBProgressHUDManager removeHUD];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}





@end
